package com.noahplat.user.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 权限表
 *
 * @author
 * @version 1.0.0
 * @Date: 2021/2/24 15:48
 **/

@Data
@Table(name = "tb_role")
public class Role {

    @Id
    private Long id;
    @Id
    private Long acctid; //账套id
    @Id
    private Long stid; //系统ID

    @NotEmpty(message = "角色不能为空")
    @Length(max = 32, message = "长度不能超过32位")
    private String role; //角色

    @NotNull(message = "参数不能为null")
    @Length(max = 128, message = "长度不能超过182位")
    private String description; //角色描述

    @Length(max = 32, message = "长度不能超过32位")
    @Column(name = "created_by")
    private String createdBy; //创建者

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "created_time")
    private Date createdTime; //创建时间 账套创建时间

    @Transient
    private Long uid;

}
